package java学习.第09章_异常处理;

/**
 *
 */
public class B3_手动抛出异常 {
    public static void main(String[] args) {

        try {//只有编译时异常才会爆红
            //手动抛出异常
            //java.lang.MyException: 沙雕
            throw new MyException("沙雕");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
class MyException extends Exception{

    //标识号 用来唯一标识此类
    static final long serialVersionUID = 001L;
    public MyException() {
        super();
    }

    public MyException(String message) {
        super(message);
    }

}
